package com.test.Redis;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @Author: 浪客
 * @Date: 2021-08-14 17:47
 * @Description: redis
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class Redis {
    @Autowired
    private RedisTemplate redisTemplate;

    @Test
    public void redis(){
        redisTemplate.opsForValue().set("java","hello");
        System.out.println(redisTemplate.opsForValue().get("java"));
    }
}
